/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.oai.metadataRepository.harvest;

import cz.mzk.oai.metadataRepository.metadata.DateStamp;

/**
 *
 * @author martin
 */
public interface MarcHarvester {

    /**
     * This method 'harvests' the metadata. It replaces all the items.
     * @param thorough if true all the collections are searched for metadata record when proccessing it.
     * There are two situations that it 'thorough' should be true:
     * 1. Rules for collection selection have changed
     * 2. Content of some metadata files (that could influence collection decision) changes
     * In both situations the metadata file can be moved to different place (in directory structure) than before.
     * So with 'thorought' = true the file is removed from collection in which it now doesn't belong
     * @param from harvest only items changed/created after this
     * @param until harvest only items changed/created before this
     */
    void harvestAndReplace(DateStamp from, DateStamp until, boolean thorough);
    

    /**
     * This method 'harvests' the metadata. It replaces items only if new version is available.
     * @param thorough if true all the collections are searched for metadata record when proccessing it.
     * There are two situations that it 'thorough' should be true:
     * 1. Rules for collection selection change
     * 2. Content of some metadata files (that could influence collection decision) changes
     * In both situations the metadata file can be moved to different place (in directory structure) than before.
     * So with 'thorought' = true the file is removed from collection in which it now doesn't belong
     * @param from harvest only items changed/created after this
     * @param until harvest only items changed/created before this
     */
    void harvestAndUpdate(DateStamp from, DateStamp until, boolean thorough);

    /**
     * This method releases allocated resources. (Files etc.)
     * Should be called after we finish working with the DirectoryHarvester instance
     */
    void close();
}
